<extend name="Public/base"/>
<block name='style'>
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link rel="stylesheet" type="text/css" href="__ASSETS__/global/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="__ASSETS__/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>
    <!-- END PAGE LEVEL STYLES -->

</block>
<block name="body">
    <div class="col-md-12">
        <!-- BEGIN Portlet PORTLET-->
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption font-green-sharp">
                    <i class="icon-speech font-green-sharp"></i>
                    <span class="caption-subject"> Portlet</span>
                    <span class="caption-helper">more samples...</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle green-meadow " href="{:U('User/add')}" data-toggle="modal">
                        <i class="fa fa-plus"></i> 新增 </a>
                    <button class="btn btn-circle green-meadow ajax-post" url="{:U('changeStatus?method=resumeUser')}" target-form="ids">
                        <i class="fa fa-check"></i> 启 用 </button>
                    <button class="btn btn-circle grey-cascade ajax-post" url="{:U('changeStatus?method=forbidUser')}" target-form="ids">
                        <i class="fa fa-ban"></i> 禁 用 </button>
                    <button class="btn btn-circle red-sunglo ajax-post confirm" url="{:U('changeStatus?method=deleteUser')}" target-form="ids">
                        <i class="fa fa-trash-o"></i> 删 除 </button>

                </div>
            </div>
            <div class="portlet-body">

                <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                        <tr>
                            <th class="table-checkbox row-selected">
                                <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
                            </th>       
                            <th class="">UID</th>
                            <th class="">昵称</th>
                            <th class="">积分</th>
                            <th class="">登录次数</th>
                            <th class="">最后登录时间</th>
                            <th class="">最后登录IP</th>
                            <th class="">状态</th>
                            <th class="">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <notempty name="_list">
                        <volist name="_list" id="vo">
                            <tr class="odd gradeX">
                                <td><input class="checkboxes ids" type="checkbox" name="id[]" value="{$vo.uid}" /></td>
                                <td>{$vo.uid} </td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.score}</td>
                                <td>{$vo.login}</td>
                                <td><span>{$vo.last_login_time|time_format}</span></td>
                                <td><span>{:long2ip($vo['last_login_ip'])}</span></td>
                                <td>{$vo.status_text}</td>
                                <td><eq name="vo.status" value="1">
                                    <a href="{:U('User/changeStatus?method=forbidUser&id='.$vo['uid'])}" class="ajax-get">禁用</a>
                                    <else/>
                                    <a href="{:U('User/changeStatus?method=resumeUser&id='.$vo['uid'])}" class="ajax-get">启用</a>
                                    </eq>
                                <a href="{:U('AuthManager/group?uid='.$vo['uid'])}" class="authorize">授权</a>
                                <a href="{:U('User/changeStatus?method=deleteUser&id='.$vo['uid'])}" class="confirm ajax-get">删除</a>
                                </td>
                            </tr>
                        </volist>
                        <else/>
                        <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
                    </notempty>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- END Portlet PORTLET-->
    </div>
    <!-- END PAGE CONTENT-->

</block>

<block name='script'>
    <script type="text/javascript" src="__ASSETS__/admin/pages/scripts/table-managed.js"></script>
    <script type="text/javascript" src="__ASSETS__/global/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="__ASSETS__/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="__ASSETS__/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
    <script>
        jQuery(document).ready(function () {
            TableManaged.init();
        });

    </script>
</block>